<template>
  <div class="">
    <van-nav-bar
      title="推荐列表"
      left-text=""
      left-arrow
      @click-left="$router.go(-1)"
    />
    <div class="box">
      <moodsCard @click="$router.push('/details?id=' + v.id)" v-for="(v, i) in obj" :key="i" :moodsList="v"></moodsCard>
    </div>
  </div>
</template>

<script>
import moodsCard from "@/components/cardComponents/moodsCard";
import { moodsList } from "@/api";
import { ref } from "vue";
export default {
  setup(props) {
    const obj = ref([]);
    moodsList().then((result) => {
      if(result.code != 0) return
      obj.value = result.data;
    });
    return {
      obj,
    };
  },
  components: {
    moodsCard,
  },
};
</script>

<style lang="scss" scoped>
.box {
  display: flex;
  flex-wrap: wrap;
}
</style>
